const trace = [
    [
        "936",
        "140",
        1690717284490
    ],
    [
        "962",
        "154",
        1690717284490
    ],
    [
        "962",
        "154",
        1690717284492
    ],
    [
        "963",
        "154",
        1690717285318
    ],
    [
        "964",
        "154",
        1690717285323
    ],
    [
        "964",
        "154",
        1690717285337
    ],
    [
        "965",
        "154",
        1690717285362
    ],
    [
        "966",
        "154",
        1690717285367
    ],
    [
        "966",
        "153",
        1690717285373
    ],
    [
        "967",
        "153",
        1690717285380
    ],
    [
        "968",
        "153",
        1690717285393
    ],
    [
        "968",
        "153",
        1690717285404
    ],
    [
        "969",
        "153",
        1690717285447
    ],
    [
        "968",
        "153",
        1690717285828
    ],
    [
        "968",
        "153",
        1690717285901
    ],
    [
        "967",
        "153",
        1690717285913
    ],
    [
        "967",
        "153",
        1690717286645
    ]
]

function string10to64(a) {
    var b = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-~'['split']('')
        , c = b['length']
        , d = +a
        , e = [];
    do {
        mod = d % c;
        d = (d - mod) / c;
        e['unshift'](b[mod]);
    } while (d);
    return e['join']('');
}

function prefixInteger(a, b) {
    return (Array(b)['join'](0x0) + a)['slice'](-b);
}

function pretreatment(a, b, c) {
    var d = this;
    var e = string10to64(Math['abs'](a));
    var f = '';
    if (!c) {
        f += a > 0x0 ? '1' : '0';
    }
    f += prefixInteger(e, b);
    return f;
}

function getCoordinate(a) {

    var b = this;
    var c = new Array();
    for (var d = 0x0; d < a['length']; d++) {
        if (d == 0x0) {
            c['push'](pretreatment(a[d][0x0] < 0x3ffff ? a[d][0x0] : 0x3ffff, 0x3, !![]));
            c['push'](pretreatment(a[d][0x1] < 0xffffff ? a[d][0x1] : 0xffffff, 0x4, !![]));
            c['push'](pretreatment(a[d][0x2] < 0x3ffffffffff ? a[d][0x2] : 0x3ffffffffff, 0x7, !![]));
        } else {
            var e = a[d][0x0] - a[d - 0x1][0x0];
            var f = a[d][0x1] - a[d - 0x1][0x1];
            var g = a[d][0x2] - a[d - 0x1][0x2];
            c['push'](pretreatment(e < 0xfff ? e : 0xfff, 0x2, ![]));
            c['push'](pretreatment(f < 0xfff ? f : 0xfff, 0x2, ![]));
            c['push'](pretreatment(g < 0xffffff ? g : 0xffffff, 0x4, !![]));
        }
    }
    return c['join']('');
}

function get_b(){

return getCoordinate(trace)

}
// 京东轨迹 加密算法
console.log(get_b() === "0eE002coCCCCya10q10e0000000000000210100000cW1010000005000000000e101000000p101000000500000100061010000007101000000d000000000b101000000H001000005Z0000000019001000000c00000000bs");
